import api from './request'

const hasPermission = {
	install(Vue) {

		Vue.directive('auth', {

			bind(el, binding) {

				api.post('/login/checkAuthButton', binding.value).then(response => {

					if (!response.data) {
						el.parentNode.removeChild(el);
					}
				});
			}
		});
	}
};

export default hasPermission;
